function results = SVMMatlab(cfg,data,timecoursevariant,SVMpass)

%Train SVM:
svmstruct=svmtrain(data.trainmatrix',data.trainevents+1,'Kernel_Function',cfg.kerneltype);

%Test SVM:
results.(timecoursevariant).classified{SVMpass}=svmclassify(svmstruct,data.testmatrix');
results.(timecoursevariant).cp{SVMpass}=classperf(double(results.(timecoursevariant).classified{1}(data.testevents==1)),double(data.testevents(data.testevents==1)+1));
fid=figure;
plot(double(results.(timecoursevariant).classified{1}));

end